﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WGM
{
    public partial class PageStats : Page
    {
        public PageStats()
        {
            InitializeComponent();
        }

        ClassSQL ClassSQL = new ClassSQL();

        private void page_stats_Loaded(object sender, RoutedEventArgs e)
        {
            ClassSQL.total_gamestime(this);
            ClassSQL.avg_gamestime(this);

            ClassSQL.total_gamestimeday(this);
            ClassSQL.total_gamestimeweek(this);
            ClassSQL.total_gamestimemonth(this);

            ClassSQL.total_game(this);
            ClassSQL.total_gamecompleted(this);

            ClassSQL.topgame(this);
            ClassSQL.topgame_day(this);
            ClassSQL.topgame_week(this);
            ClassSQL.topgame_month(this);
            ClassSQL.topgame_playtime(this, 2);
        }

        private void button_type_Click(object sender, RoutedEventArgs e)
        {
            button_played.IsEnabled = true;
            button_type.IsEnabled = false;
            tabcontrol_mostplayed.Visibility = Visibility.Hidden;
            tabcontrol_type.Visibility = Visibility.Visible;

            ClassSQL.Action(this, 1);
            ClassSQL.Aventure(this, 1);
            ClassSQL.FPS(this, 1);
            ClassSQL.MMORPG(this, 1);
            ClassSQL.Racing(this, 1);
            ClassSQL.RPG(this, 1);
            ClassSQL.Simulation(this, 1);
            ClassSQL.Strategy(this, 1);
            ClassSQL.Survival(this, 1);

        }

        private void button_played_Click(object sender, RoutedEventArgs e)
        {
            button_played.IsEnabled = false;
            button_type.IsEnabled = true;
            tabcontrol_mostplayed.Visibility = Visibility.Visible;
            tabcontrol_type.Visibility = Visibility.Hidden;
        }

        private void name_Click(object sender, RoutedEventArgs e)
        {
            ClassSQL.Action(this, 1);
            ClassSQL.Aventure(this, 1);
            ClassSQL.FPS(this, 1);
            ClassSQL.MMORPG(this, 1);
            ClassSQL.Racing(this, 1);
            ClassSQL.RPG(this, 1);
            ClassSQL.Simulation(this, 1);
            ClassSQL.Strategy(this, 1);
            ClassSQL.Survival(this, 1);
        }

        private void lastplayed_Click(object sender, RoutedEventArgs e)
        {
            ClassSQL.Action(this, 2);
            ClassSQL.Aventure(this, 2);
            ClassSQL.FPS(this, 2);
            ClassSQL.MMORPG(this, 2);
            ClassSQL.Racing(this, 2);
            ClassSQL.RPG(this, 2);
            ClassSQL.Simulation(this, 2);
            ClassSQL.Strategy(this, 2);
            ClassSQL.Survival(this, 2);
        }

        private void playtime_Click(object sender, RoutedEventArgs e)
        {
            ClassSQL.topgame_playtime(this, 2);
        }

        private void playtimename_Click(object sender, RoutedEventArgs e)
        {
            ClassSQL.topgame_playtime(this, 1);
        }
    }
}
